<?php

include_once 'DataAccess/crudData.php';

class API {

	/**
	 * @url GET test
	 */
	function toTest() {
		include $_SERVER["DOCUMENT_ROOT"] . 'indexTest.php';
	}
	
	/**
	 * @url GET joe
	 */
	function toJoeTest() {
		include $_SERVER["DOCUMENT_ROOT"] . 'joeIndexTest.php';
	}
	
	/**
	 * @url GET perron
	 */
	function toPerronTest() {
		include $_SERVER["DOCUMENT_ROOT"] . 'perronIndexTest.php';
	}
	

	/*
	 * -----------------------------------------------------------
	 * ---------------------- Tile Section -----------------------
	 * -----------------------------------------------------------
	 */

	/**
	 * @url POST tile
	 */
	function createTile() {
		// create a tile
		createTile($_POST['image'], $_POST['name'], $_POST['width'], $_POST['height'], $_POST['yards'], $_POST['colorID'], $_POST['amountLeft']);
	}

	/**
	 * @url GET tile
	 */
	function readAllTiles() {
		// read all of the tiles
		readAllTiles();
	}

	/**
	 * @url GET tile/:id
	 */
	function readTile($id = null) {
		// read a tile
		readTile($id);
	}

	/**
	 * @url DELETE tile/:id
	 */
	function deleteTile($id = null) {
		// delete a tile
		deleteTile($id);
	}

	/**
	 * @url PUT tile/:id
	 */
	function updateTile($id = null) {
		// update a tile
		updateTile($id, $_POST['image'], $_POST['name'], $_POST['width'], $_POST['height'], $_POST['yards'], $_POST['colorID'], $_POST['amountLeft']);
	}

}
?>